import http from "@/common/http/request";
import { courseCategoryAddInterface, courseCategoryListInterface, courseCategoryUpdateInterface } from "./courseCategory.interface";

// 课程分类列表
export const $courseCategoryList = (data: courseCategoryListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/piano/courseCategory/list',
    data,
  })
}

//钢琴课程分类树
export const $courseCategoryListTree = () => {
  const $http = new http();
  return $http.get({
    url: '/piano/courseCategory/listTree',
  })
}

//新增钢琴课程分类
export const $courseCategoryAdd = (data: courseCategoryAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/piano/courseCategory',
    data,
  })
}

//更新钢琴课程分类
export const $courseCategoryUpdate = (data: courseCategoryUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/piano/courseCategory',
    data,
  })
}

//钢琴课程分类详情
export const $courseCategoryDetail = (data: string) => {
  const $http = new http();
  return $http.get({
    url: `/piano/courseCategory/${data}`,
  })
}

//删除钢琴课程分类
export const $courseCategoryDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/piano/courseCategory/${data.join(',')}`,
  })
}


